package com.sx.gongzhong.net;

import com.sx.gongzhong.model.BasePageListBean;
import com.sx.gongzhong.model.CommentBean;
import com.sx.gongzhong.model.ConvenniceAppealBean;
import com.sx.gongzhong.model.PublicBean;
import com.sx.gongzhong.model.ReplyUserBean;

import java.util.List;
import java.util.Map;

import retrofit2.Call;

/**便民诉求
 * Created by admin on 2018/1/11.
 */

public class AppealManager {
    /**
     * 获取便民诉求列表
     */
    public void getConvenniceAppealData(Map<String, Object> map, BaseCallBack<ReplyUserBean.BaseResult<BasePageListBean<ConvenniceAppealBean>>> baseCallBack) {
        ApiManagerService service = ServiceFactory.getInstance().createNewService(ApiManagerService.class);
        Call<ReplyUserBean.BaseResult<BasePageListBean<ConvenniceAppealBean>>> resultCall = service.getConvenniceAppealData(map);
        resultCall.enqueue(baseCallBack);
    }
    /**
     * 添加便民诉求
     */
    public void addConvenniceAppeal(Map<String, Object> map, BaseCallBack<ReplyUserBean.BaseResult<Void>> baseCallBack) {
        ApiManagerService service = ServiceFactory.getInstance().createNewService(ApiManagerService.class);
        Call<ReplyUserBean.BaseResult<Void>> resultCall = service.addConvenniceAppeal(map);
        resultCall.enqueue(baseCallBack);
    }

    /**
     * 诉求选项辖区列表
     */
    public void getOrgList(Map<String, Object> map, BaseCallBack<ReplyUserBean.BaseResult<List<PublicBean>>> baseCallBack) {
        ApiManagerService service = ServiceFactory.getInstance().createNewService(ApiManagerService.class);
        Call<ReplyUserBean.BaseResult<List<PublicBean>>> resultCall = service.getOrgList(map);
        resultCall.enqueue(baseCallBack);
    }
    /**
     * 便民诉求详情
     */
    public void getAppealDetail(Map<String, Object> map, BaseCallBack<ReplyUserBean.BaseResult<ConvenniceAppealBean>> baseCallBack) {
        ApiManagerService service = ServiceFactory.getInstance().createNewService(ApiManagerService.class);
        Call<ReplyUserBean.BaseResult<ConvenniceAppealBean>> resultCall = service.getAppealDetail(map);
        resultCall.enqueue(baseCallBack);
    }

    /**
     * 便民訴求答復列表
     */
    public void getAppealReplyList(Map<String, Object> map, BaseCallBack<ReplyUserBean.BaseResult<BasePageListBean<CommentBean>>> baseCallBack) {
        ApiManagerService service = ServiceFactory.getInstance().createNewService(ApiManagerService.class);
        Call<ReplyUserBean.BaseResult<BasePageListBean<CommentBean>>> resultCall = service.getAppealReplyList(map);
        resultCall.enqueue(baseCallBack);
    }
    /**
     * 便民訴求评论列表
     */
    public void getAppealCommentList(Map<String, Object> map, BaseCallBack<ReplyUserBean.BaseResult<BasePageListBean<CommentBean>>> baseCallBack) {
        ApiManagerService service = ServiceFactory.getInstance().createNewService(ApiManagerService.class);
        Call<ReplyUserBean.BaseResult<BasePageListBean<CommentBean>>> resultCall = service.getAppealCommentList(map);
        resultCall.enqueue(baseCallBack);
    }

    /**
     * 便民訴求诉求点赞
     */
    public void addPraise(Map<String, Object> map, BaseCallBack<ReplyUserBean.BaseResult<Integer>> baseCallBack) {
        ApiManagerService service = ServiceFactory.getInstance().createNewService(ApiManagerService.class);
        Call<ReplyUserBean.BaseResult<Integer>> resultCall = service.addPraise(map);
        resultCall.enqueue(baseCallBack);
    }
    /**
     * 便民訴求添加评论
     */
    public void addAppealComment(Map<String, Object> map, BaseCallBack<ReplyUserBean.BaseResult<CommentBean>> baseCallBack) {
        ApiManagerService service = ServiceFactory.getInstance().createNewService(ApiManagerService.class);
        Call<ReplyUserBean.BaseResult<CommentBean>> resultCall = service.addAppealComment(map);
        resultCall.enqueue(baseCallBack);
    }
    /**
     * 便民诉求（删除）
     */
    public void deleteAppeal(Map<String, Object> map, BaseCallBack<ReplyUserBean.BaseResult<Boolean>> baseCallBack) {
        ApiManagerService service = ServiceFactory.getInstance().createNewService(ApiManagerService.class);
        Call<ReplyUserBean.BaseResult<Boolean>> resultCall = service.deleteAppeal(map);
        resultCall.enqueue(baseCallBack);
    }
    /**
     * 便民诉求（评价）
     */
    public void addEvaluation(Map<String, Object> map, BaseCallBack<ReplyUserBean.BaseResult<Void>> baseCallBack) {
        ApiManagerService service = ServiceFactory.getInstance().createNewService(ApiManagerService.class);
        Call<ReplyUserBean.BaseResult<Void>> resultCall = service.addEvaluation(map);
        resultCall.enqueue(baseCallBack);
    }
    /**
     * 获取 我的便民诉求 列表
     */
    public void getMyConvenniceAppealData(Map<String, Object> map,
                                          BaseCallBack<ReplyUserBean.BaseResult<BasePageListBean<ConvenniceAppealBean>>> baseCallBack) {
        ApiManagerService service = ServiceFactory.getInstance().createNewService(ApiManagerService.class);
        Call<ReplyUserBean.BaseResult<BasePageListBean<ConvenniceAppealBean>>> resultCall = service.getMyConvenniceAppealData(map);
        resultCall.enqueue(baseCallBack);
    }

}
